package com.runewbie.pafcmall.ware.dao;

import com.runewbie.pafcmall.ware.entity.WareSkuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 商品库存
 *
 * @author runewbie
 * @email 0102lijian@gmail.com
 * @date 2020-04-12 11:07:20
 */
@Mapper
public interface WareSkuDao extends BaseMapper<WareSkuEntity> {

    /**
     * 将成功采购的进行入库
     *
     * @param skuId
     * @param wareId
     * @param skuNum
     */
    void addStock(@Param("skuId") Long skuId, @Param("wareId") Long wareId, @Param("skuNum") Integer skuNum);

    /**
     * 查询当前sku的总库存量
     *
     * @param skuId
     * @return
     */
    Long getSkuStock(@Param("skuId") Long skuId);
}
